package fr.maistre.SystemeMarché.Implementation;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import fr.maistre.SystemeMarché.Interface.Marketable;


public class ReferenceMarket implements Serializable {

	public double BESOIN_CAPITAL;
	public double CONSOMMATION;
	public double COUT_MATIERE;
	public double INVESTISSEMENT;
	public double MASSE_SALARIALE;
	public double DEMANDE;
	public double ECONOMIE_ECHELLE;
	public double CAPA_PRODUCTION;
	public double NBR_TRAVAILLEUR;
	public double INVESTISSEMENT_TECHNO;
	public double REMK;
	public double OFFRE;
	public double INFRA_CIBLE;
	public double COUT_INFRA;
	public double COUT_PROD;

	public double partMarché;
	public double coutMatiereParItem;
	public double production;
	public double besoinInfra;

	public double prix;
	public double technologie;
	public double capital;
	
	private final HashMap<String,Double> matieresPremieres =  new HashMap<String, Double>(); 
	private final HashMap<String,Double> infrastructures =  new HashMap<String, Double>();
	
	public final List<Double> previousPrices = new ArrayList<Double>();

	public boolean isActualised = false; 

	public ReferenceMarket(double partMarché, double coutMatiereParItem,
			double production, double besoinInfra, double prix, double technologie,
			double capital) {
		super();

		this.partMarché = partMarché;
		this.production = production;
		this.besoinInfra = besoinInfra;
		this.prix = prix;
		this.technologie = technologie;
		this.capital = capital;
		this.coutMatiereParItem = coutMatiereParItem;
		this.previousPrices.add(this.prix);

	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.maistre.SystemeMarché.Implementation.ReferenceMarkete#addInfrastructure
	 * (fr.maistre.SystemeMarché.Interface.Marketable, double)
	 */
	public void addInfrastructure(Marketable infraMere, double factor){
		this.infrastructures.put(infraMere.getReferenceMarket(), factor);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.maistre.SystemeMarché.Implementation.ReferenceMarkete#addMatierePremiere
	 * (fr.maistre.SystemeMarché.Interface.Marketable, double)
	 */
	public void addMatierePremiere(Marketable infraMere, double factor){
		this.matieresPremieres.put(infraMere.getReferenceMarket(), factor);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.maistre.SystemeMarché.Implementation.ReferenceMarkete#getMatieresPremieres
	 * ()
	 */
	public HashMap<String, Double> getMatieresPremieres() {
		// voir comment ne renvoyer que la valeur de la map (copie ?) pour
		// empecher toute modification exterieure
		return matieresPremieres;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.maistre.SystemeMarché.Implementation.ReferenceMarkete#getInfrastructures
	 * ()
	 */
	public HashMap<String, Double> getInfrastructures() {
		return infrastructures;
	}



}